#define _CRT_SECURE_NO_WARNINGS 1



# include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
    ll n, m;
    cin >> n >> m;
    vector<ll> medical(n + 1), last_have(n + 1, -1);
    for (ll i = 1; i <= n; ++i)
    {
        cin >> medical[i];
    }
    for (ll i = 0; i < m; ++i)
    {
        ll t, k;
        cin >> t >> k;
        for (ll j = 0; j < k; ++j)
        {
            ll tmp = 0;
            cin >> tmp;
            if (!(medical[tmp] == -1 || last_have[tmp] == -1
                || abs(last_have[tmp] - t) >= medical[tmp]))
            {
                printf("Don't take %d at %d!\n", tmp, t);
            }
            else last_have[tmp] = t;
        }
    }
    return 0;
}